package com.gujiayue.common.config;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import com.gujiayue.common.filter.RequestFilter;

@Component
public class WebMvcConfig extends WebMvcConfigurationSupport {

	@Resource
	private RequestFilter requestFilter;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 跨域拦截器
		registry.addInterceptor(requestFilter).addPathPatterns("/**");
	}
}